package org.kuan.lab.common.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.kuan.lab.base.entity.BaseEntity;

/**
 * Project: erp<br>
 * Description: 资源实体<br>
 * Copyright (c) 2012<br>
 * All Rights Reserved.<br>
 * @author <a href="mailto:gly420@163.com">GuanLuYong</a><br>
 */
@Entity
@Table(name = "ERP_RESOURCE", schema = "DEVA")
public class Resource extends BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Column(name = "CODE", length = 50)
	private String code;
	
	@Column(name = "NAME", length = 50)
	private String name;
	
	@Column(name = "URL", length = 250)
	private String url;
	
	@Column(name = "TYPE", length = 50)
	private String type;
	
	@Column(name = "PARENT_ID")
	private Long parentId;
	
	@OneToMany(mappedBy = "res")
	private List<UserResource> userResources;

	@OneToMany(mappedBy = "res")
	private List<RoleResource> roleResources;
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public List<UserResource> getUserResources() {
		return userResources;
	}

	public void setUserResources(List<UserResource> userResources) {
		this.userResources = userResources;
	}

	public List<RoleResource> getRoleResources() {
		return roleResources;
	}

	public void setRoleResources(List<RoleResource> roleResources) {
		this.roleResources = roleResources;
	}
	
}
